package mfuny.ggongal.admin.etc;

import java.util.HashMap;
import java.util.List;

import mfuny.ggongal.admin.Server;

import org.springframework.web.servlet.ModelAndView;

import com.ibatis.sqlmap.client.SqlMapClient;

public class ZipService {
	SqlMapClient sqlMapper;
	ModelAndView mav;
	
	public ZipService() throws Exception {
		sqlMapper = Server.getSqlMapper();
		mav = new ModelAndView();
	}
	
	//동검색 팝업.
	public ModelAndView zipPopup() throws Exception {
		mav.clear();
		mav.setViewName("/zip/zipPopup");
		return mav;
	}
	
	//동검색 리스트 출력.
	@SuppressWarnings("unchecked")
	public ModelAndView searchDongList(String dong) throws Exception {
		List<HashMap<String, Object>> zipList = sqlMapper.queryForList("zip_dongSearch", dong);
		mav.clear();
		mav.setViewName("/zip/zipPopup_detail");
		mav.addObject("zipList", zipList);
		return mav;
	}
}
